package com.shopping.auth.component;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * 微博授权参数
 *
 * @author Europa
 */
@Data
@Component
@ConfigurationProperties(prefix = "spring.cloud.alicloud.body")
public class WeiboAuthArgs {

    /**
     * App Key
     */
    private String clientId;

    /**
     * App Secret
     */
    private String clientSecret;

    /**
     * 授权码模式
     */
    private String grantType;

    /**
     * 授权回调页
     */
    private String redirectUri;

    public Map<String, String> bodies(String code) {
        HashMap<String, String> map = new HashMap<>(16);
        map.put("client_id", clientId);
        map.put("client_secret", clientSecret);
        map.put("grant_type", grantType);
        map.put("redirect_uri", redirectUri);
        map.put("code", code);
        return map;
    }


}
